#include "Process.h"
#include <iostream>
class Test
{
public:
	Test(void)
	{

	}
	Test(const Test&) = delete;
	Test(Test&& rhs)
	{
		std::cout << "Move constructor\n";
	}
	~Test(void)
	{
		std::cout << "Destructor\n";
	}
	Test& operator=(const Test& rhs) = delete;
	Test& operator=(Test&& rhs)
	{
		std::cout << "Move operator\n";
		return *this;
	}
	int x;


};
DWORD __stdcall EntryPoint(void* x)
{
	__asm
	{
		mov eax, 0x1337
		mov ebx, 0x1337
	}
	MessageBoxA(0, "LOL", "LOOOOL", MB_OK);
	return 1;
}


/**** EXAMPLES *****/


/*
Injects library using Windows API
Can also be used to .exe files, though obviously no DllMain will be called in that case.
*/
void InjectLibrary(const char* processName, const char* libPath)
{
	Process p(processName);
	p.InjectLibrary(libPath);
}






int main(int argc, char** argv)
{
	try
	{
		Process p("notepad.exe");
		p.InjectModuleRaw(GetModuleHandle(0), EntryPoint);
		//p.InjectLibrary("C:\\Code\\C++\\TestDLL\\Release\\TestDLL.dll");
	}
	catch (std::runtime_error& e)
	{
		std::cout << "Error - " << e.what() << std::endl;
	}

	std::cin.get();
}